// pages/wb/edit-msg.js
const app = getApp();
console.log(global);
Page({

    /**
     * 页面的初始数据
     */
    data: {
        item: [{
                title: '有效期：',
                star: true,
                name: 'type',
                data: [{
                        value: '',
                        name: '15天',
                        checked: true,
                    },
                    {
                        value: '',
                        name: '30天',
                    },
                ]
            },
            {
                title: '车辆详情：',
                name: 'carType',
                star: true,
                data: [{
                        value: '',
                        name: '新车',
                        checked: true,
                    },
                    {
                        value: '',
                        name: '旧车',
                    },
                ]
            },

            {
                title: '',
                star: false,
                name: 'carPlaceOrigin',

                data: [{
                        value: '',
                        name: '国产车',
                        checked: true,
                    },
                    {
                        value: '',
                        name: '进口车'
                    }
                ]
            },
            {
                title: '',
                star: false,
                name: 'carPurpose',

                data: [{
                    value: '',
                    name: '私家车',
                    checked: true,
                }, {
                    value: '',
                    name: '公车',
                }, ]
            },
            {
                title: '',
                star: false,
                name: 'infoType',

                data: [{
                        value: '',
                        name: '扫描件',
                        checked: true,

                    },
                    {
                        value: '',
                        name: '照片'
                    }
                ]
            },
            {
                title: '办理次数：',
                star: true,
                name: 'finishNumber',
                data: [{
                        value: '',
                        name: '首次',
                        checked: true,

                    },
                    {
                        value: '',
                        name: '2/3次'
                    },
                    {
                        value: '',
                        name: '其他'
                    }
                ]
            },
        ],

    },


    radioChange(e) {
        var index = e.target.dataset.index

    },

    onShow() {
        const data = getApp().getTmpPlate();
        this.setData({
            data,
        });
    },
    submit(e) {
        let post = e.detail.value;
        if (!post.carAddress) {
            return wx.showToast({
                icon: 'none',
                title: '请输入车辆所属地',
            });
        }
        getApp().setTmpPlate(post);
        wx.navigateTo({
            url: './upload',
        });
    },
})